export const arabicToChinese = (number: number): string => {
  const units: string[] = [
    "",
    "一",
    "二",
    "三",
    "四",
    "五",
    "六",
    "七",
    "八",
    "九",
  ];
  const tens: string[] = [
    "",
    "十",
    "二十",
    "三十",
    "四十",
    "五十",
    "六十",
    "七十",
    "八十",
    "九十",
  ];

  let result: string = "";

  const hundredsDigit: number = Math.floor(number / 100);
  const tensDigit: number = Math.floor((number % 100) / 10);
  const onesDigit: number = number % 10;

  if (hundredsDigit > 0) {
    result += units[hundredsDigit] + "百";
  }

  if (tensDigit > 0) {
    result += tens[tensDigit];
  }

  if (onesDigit > 0) {
    result += units[onesDigit];
  }

  return result;
};
